﻿@namespace AntDesign
@using AntDesign.TableModels
@inherits ColumnBase

@if (IsInitialize)
{
	return;
}
else if (Hidden)
{
    return;
}
else if (IsPlaceholder)
{
	<td style="padding: 0px; border: 0px; height: 0px;"></td>
}
else if (IsMeasure)
{
	<td style="padding: 0px; border: 0px; height: 0px;"><div style="height: 0px; overflow: hidden;">&nbsp;</div></td>
}
else if (IsColGroup)
{
	if (Width != null)
	{
		<col class="ant-table-selection-col" style="width: @((CssSizeLength)Width); min-width: @((CssSizeLength)Width);">
	}
	else
	{
		<col class="ant-table-selection-col">
	}
}
else if (IsHeader && HeaderColSpan != 0)
{
	<th class="@ClassMapper.Class ant-table-selection-column" style="@FixedStyle @HeaderStyle" @key="@Key" colspan="@HeaderColSpan">
		@if (Type == SelectionType.Checkbox)
		{
			<Checkbox Checked="Table.AllSelected" CheckedChange="OnCheckedChange" Indeterminate="Indeterminate" Disabled="IsHeaderDisabled" />
		}
	</th>
}
else if (!IsHeader && RowSpan != 0 && ColSpan != 0)
{
	<td class="@ClassMapper.Class ant-table-selection-column" style="@FixedStyle @Style" @key="@Key" rowspan="@RowSpan" colspan="@ColSpan">

		@if (CellRender != null)
		{
			var cellData = new CellData(RowData);
            @CellRender(cellData)
		}
		else if (ChildContent != null)
		{
			@ChildContent
		}
		else
		{
            HandleSelected();

			@if (Type == SelectionType.Checkbox)
			{
				<Checkbox Checked="_selected.Value" Disabled="Disabled" CheckedChange="OnCheckedChange" />
			}
			else if (Type == SelectionType.Radio)
			{
                <Radio Checked="_selected.Value" Disabled="Disabled" CheckedChange="OnCheckedChange" TValue="bool" />
			}
		}
	</td>
}